﻿app
    //.config(['$compileProvider', function ($compileProvider) {
    //    $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/);
    //}])
.config(function ($routeProvider) {
    $routeProvider
        .when('/',
            {
                controller: 'LoginController',
                templateUrl: 'views/loginView.html'
            })
        .when('/notification',
            {
                controller: 'NotificationController',
                templateUrl: 'views/notificationView.html'
            })
        .when('/newFriend',
            {
                controller: 'NewFriendController',
                templateUrl: 'views/notificationNewFriendView.html'
            })
        .when('/newMessage',
            {
                controller: 'NewMessageController',
                templateUrl: 'views/notificationNewMessageView.html'
            })
        .when('/newFromRoom',
            {
                controller: 'NewFromRoomController',
                templateUrl: 'views/notificationNewFromRoomView.html'
            })
        .when('/lesson/:roomId/:lessonId',
            {
                controller: 'LessonController',
                templateUrl: 'views/lessonView.html'
            })
        .when('/room',
            {
                controller: 'UserRoomController',
                templateUrl: 'views/roomView.html'
            })
        .when('/lessonManage',
            {
                controller: 'LessonManagerController',
                templateUrl: 'views/lessonManageView.html'
            })
        .when('/createLesson',
            {
                controller: 'CreateLessonController',
                templateUrl: 'views/createLessonView.html'
            })
        .when('/createLesson/:lessonId',
            {
                controller: 'CreateLessonController',
                templateUrl: 'views/createLessonView.html'
            })
        .when('/createUser',
            {
                controller: 'CreateUserController',
                templateUrl: 'views/createUserView.html'
            })
        .when('/userManage',
            {
                controller: 'UserController',
                templateUrl: 'views/userView.html'
            })
        .when('/userDetail/:userId/:routeid',
            {
                controller: 'UserDetailController',
                templateUrl: 'views/userDetailView.html'
            })
        .when('/userDetail',
            {
                controller: 'UserDetailController',
                templateUrl: 'views/userDetailView.html'
            })
        .when('/profile/:userId',
            {
                controller: 'ProfileController',
                templateUrl: 'views/profileView.html'
            })
        .when('/profile',
            {
                controller: 'ProfileController',
                templateUrl: 'views/profileView.html'
            })
        .when('/groupRole',
            {
                controller: 'GroupRoleController',
                templateUrl: 'views/groupRoleView.html'
            })
         .when('/login',
            {
                controller: 'LoginController',
                templateUrl: 'views/loginView.html'
            })
        .when('/signup',
            {
                controller: 'SignupController',
                templateUrl: 'views/createUserView.html'
            })
         .when('/test',
            {
                controller: 'TestController',
                templateUrl: 'views/testView.html'
            })
        .otherwise({ redirectTo: '/' });
});

//app.config(function ($httpProvider) {
//    $httpProvider.defaults.useXDomain = true;
//    delete $httpProvider.defaults.headers.common['X-Requested-With'];
//});